package com.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PhoneNumUtil {
    //手机号格式化正则表达式
    public static boolean ifPhone(String phone){
        String regExp = "^((13[0-9])|(14[5,7,9])|(15[0-3,5-9])|(166)|(17[3,5,6,7,8])" +
                "|(18[0-9])|(19[8,9]))\\d{8}$";
        Pattern p = Pattern.compile(regExp);
        Matcher m = p.matcher(phone);
        return m.matches();
    }
}
